package com.jcl.recruit.server.elastic;

import com.jcl.core.common.page.PageResult;
import com.jcl.core.resp.ApiResponse;
import com.jcl.recruit.server.elastic.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ElasticsearchServerProxy
 * @Description TODO
 * @Author yyliu
 * @Date 2018/11/14 13:48
 * @Version 1.0
 **/
@FeignClient(
        name = "elasticsearch-server",
        path = "/elastic/resume"
)
public interface ElasticsearchServerProxy {

    @PostMapping(value = "/page/list")
    ApiResponse<PageInfo> resumePageList(@RequestBody SearchParamEntity entity);

    @GetMapping(value = "/get/{id}")
    ApiResponse<SearchResumeResultEntity> findEntity(@PathVariable(name = "id") Integer id);

    @GetMapping(value = "/get/simple/{id}")
    ApiResponse<SearchResumeSimpleResultEntity> findSimpleEntity(@PathVariable(name = "id") Integer id);

    @GetMapping(value = "/get/basic/{id}")
    ApiResponse<SearchResumeBasicEntity> findResumeBasicEntity(@PathVariable(name = "id") Integer id);

    @PostMapping(value = "/operate/download")
    ApiResponse<Map<String, Object>> downloadResume(@RequestBody SearchDownloadParamEntity entity);

    @GetMapping(value = "/get/source/count")
    ApiResponse<List<Map<String, String>>> getCountBySources(Boolean today);

}
